package com.yc.qunxing.task;

import com.yc.qunxing.mapper.UsersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class preferentialTask {

    @Autowired
    private UsersMapper usersMapper;

    @Scheduled(cron = "0 0 4 * * ?") // 每天凌晨四点执行
    public void refreshRaffleNum() {
        // 将 raffleNum 设置为 3
        usersMapper.updateRaffleNum(3);
    }
}
